﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Blog.aspx.cs" Inherits="MyVocationSpace.WebForm1" %>

<%@ Register Src="Header.ascx" TagName="header" TagPrefix="uc" %>
<%@ Register Src="Footer.ascx" TagName="footer" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>..:: MY VocationSpace ::..</title>
    <link href="css/Default.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <link href="css/MyStyle.css" rel="stylesheet" type="text/css" />
    <script src="js/common.js" type="text/javascript"></script>
    <link href="css/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="js/Popup.js" type="text/javascript"></script>
    <link href="css/NewStyle.css" rel="stylesheet" type="text/css" />
    <link href="css/Popup.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Clear() {
            document.getElementById("txtcomment").value = "";
            return false;
        }
        function sendDetails() {
            var Comment = document.getElementById("txtcomment").value;
            var topicId = document.getElementById("hdTopicID").value;
            var IsMentor = document.getElementById("hdIsMentor").value;


            if (Comment != "") {
                //if (validate(txtEmail)) {
                var xmlhttp;
                if (window.XMLHttpRequest) {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                }
                else {// code for IE6, IE5
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function () {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        document.getElementById("loading").style.display = "none";
                        //                        document.getElementById("ErrorDiv").style.display = "block";
                        document.getElementById("ErrorDiv").innerHTML = xmlhttp.responseText; ;
                        //                        document.getElementById("ErrorDiv").innerHTML = xmlhttp.responseText;
                        Clear();
                        //                        document.getElementById("type").value = "";
                    }
                }
                xmlhttp.open("POST", "AJAX/CommentDetails.aspx?Comment=" + Comment + "&topicid=" + topicId + "&IsMentor=" + IsMentor, true);
                xmlhttp.send();
                document.getElementById("ReviewPopup").style.display = "none";
                document.getElementById("blanket").style.display = "none";
                document.getElementById("loading").style.display = "block";
            }
            else if (Comment == "") {
                document.getElementById("errReview3").innerHTML = 'Please enter your Comment';
                toggleDiv('errReview3', 1);
                document.getElementById("blanket").style.display = "block";
                document.getElementById("ReviewPopup").style.display = "block";
                //                document.getElementById("ErrorDiv").innerHTML = 'Please enter your review ; Max 500 character.';
                return false;
            }
        }  
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <center>
        <div>
            <uc:header ID="header" runat="server" />
        </div>
        <div id="content-wrapper">
            <div id="CommonContentInner">
                <div id="selector">
                    <div class="mainTable">
                        <table width="790px">
                            <tr>
                                <td class="selector">
                                    <table width="780px">
                                        <tr>
                                            <td colspan="3" class="heading">
                                                <span style="color: Black">
                                                    <asp:Label ID="Label1" runat="server" Text="Topic Name:"></asp:Label></span>
                                                <div class="lableTopicName">
                                                    <asp:Label ID="lbltopicName" runat="server"></asp:Label>
                                                    <input type="hidden" runat="server" id="hdTopicID" />
                                                    <input type="hidden" runat="server" id="hdIsMentor" />
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3">
                                                <hr class="ruler" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td rowspan="5" style="vertical-align: top; width: 140px;" class="lableform">
                                                <img id="Img" runat="server" width="100" height="100" />
                                            </td>
                                            <td align="left" style="width: 300px; text-align:left">
                                                <asp:Label ID="Label2" runat="server" Style="text-align: left" Text="Username:" CssClass="lableform"></asp:Label>
                                                <asp:Label ID="lblUsername" Style="text-align: left" Font-Size="14px" runat="server"></asp:Label>
                                            </td>
                                            <td style="width: 300px; text-align:left">
                                                <asp:Label ID="Label3" runat="server" Style="text-align: left" Text="Posted Date:"
                                                    CssClass="lableform"></asp:Label>
                                                <asp:Label ID="lblPostedDate" Style="text-align: left" Font-Size="14px" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" style="text-align:left" colspan="3">
                                                <asp:Label ID="Label4" runat="server" Style="text-align: left" Text="User's Vocation Name:"
                                                    CssClass="lableform"></asp:Label>
                                                <asp:Label ID="lblUserVName" Style="text-align: left; font-size: 14px" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" style="text-align:left" colspan="3">
                                                <asp:Label ID="Label5" runat="server" Style="text-align: left" Text="Vocation Topic Name:"
                                                    CssClass="lableform"></asp:Label>
                                                <asp:Label ID="lblVocationTName" Style="text-align: left" Font-Size="14px" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="left" colspan="3" style="height: 45px; vertical-align: top;">
                                                <asp:Label ID="Label6" runat="server" Style="text-align: left" Text="Description:"
                                                    CssClass="lableform"></asp:Label>
                                                <asp:Label ID="lbldescription" Style="text-align: left" Font-Size="14px" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3" align="right" style="padding-right: 20px">
                                                <asp:Button ID="btnreply" runat="server" Text="Reply / Comment" CssClass="formBtnEdit"
                                                    OnClientClick="popup('ReviewPopup','blanket','0');return false;" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <%--   <tr>
                                <td>
                                    <hr style="color: Red;" />
                                </td>
                            </tr>--%>
                            <tr>
                                <td id="Allreplies" visible="false" align="left" style="font-family: Trebuchet MS;
                                    font-weight: bold; font-size: 17px" runat="server">
                                    All Replies.......
                                </td>
                            </tr>
                            <tr>
                                <td id="HRuler" runat="server" visible="false">
                                    <hr />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:DataList ID="DataList1" runat="server" DataKeyField="IDUser" OnItemDataBound="DataList1_ItemDataBound">
                                        <ItemTemplate>
                                            <div id="selector">
                                                <div class="mainTable">
                                                    <table width="790px" style="height: 60px;">
                                                        <tr>
                                                            <td class="selector">
                                                                <table cellpadding="1" cellspacing="2" width="780px">
                                                                    <tr>
                                                                        <td width="60px" rowspan="2" class="maindtComment" align="center">
                                                                            <img src='<%# Bind("Photo")%>' id="imgPerson" runat="server" height="50" width="50" />
                                                                        </td>
                                                                        <td>
                                                                            <div>
                                                                                <table cellpadding="1" cellspacing="2">
                                                                                    <td align="left" width="300px">
                                                                                        <asp:Label ID="Label2" runat="server" CssClass="dtName" Text='<%# Bind("Name") %>'></asp:Label>
                                                                                        said....
                                                                                    </td>
                                                                                    <td width="480px" align="right">
                                                                                        <%--  <asp:Label ID="Label7" runat="server" Text="replied on:" CssClass="dtDate"></asp:Label>--%>
                                                                                        <asp:Label ID="Label3" runat="server" CssClass="dtdisDate" Text='<%# Bind("CreationDate") %>'></asp:Label>
                                                                                    </td>
                                                                                </table>
                                                                                <hr class="ruler" />
                                                                            </div>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td width="700px" colspan="2" valign="top" align="left" style="height: 40px">
                                                                            <div class="maindtComment">
                                                                                <asp:Label ID="Label4" runat="server" CssClass="dtComment" Text='<%# Bind("Comment") %>'></asp:Label>
                                                                            </div>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>
                                        </ItemTemplate>
                                    </asp:DataList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div name="light" runat="server" id="blanket" style="display: none;" class="blanket">
                                    </div>
                                    <div id="ReviewPopup" style="display: none;" class="PopupComment">
                                        <table cellpadding="5" cellspacing="2" border="0">
                                            <tr>
                                                <td align="left" colspan="4" style="padding: 0">
                                                    <table style="height: 100%">
                                                        <tr>
                                                            <td width="480px" align="left" style="height: 40px">
                                                                <span>Add Your Comment</span>
                                                            </td>
                                                            <td width="100px" align="right" style="white-space: nowrap; background-color: White;"
                                                                valign="middle">
                                                                <a href="javascript:void(0)" onclick="$('#ReviewPopup').fadeOut('slow');$('#blanket').fadeOut('slow');"
                                                                    runat="server" id="A1" style="color: white; border: 0">
                                                                    <img alt="" src="Images/blue-close-button.png" width="14px" align="right"
                                                                        height="14px" style="border: 0" title="Close" />
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="color: Black; font-size: 12px; font-weight: bold;" align="right" valign="top">
                                                    Comment:
                                                </td>
                                                <td align="left">
                                                    <span style="float: left; padding-right: 5px">
                                                        <textarea id="txtcomment"  onfocus="toggleDiv('errReview3', 0);" style="width: 420px;
                                                            height: 150px;resize:none;"  onkeyup="limiter('txtcomment',3000);"></textarea></span>
                                                    <span style="float: left">
                                                        <div id="errReview3" class="errorDiv">
                                                        </div>
                                                    </span>
                                                </td>
                                            </tr>
                                            <%--   <tr>
                            <td style="color: Black; font-size: 12px" align="right">
                            </td>
                            <td align="left">
                            </td>
                        </tr>--%>
                                            <tr>
                                                <td colspan="2" align="center">
                                                    <div id="loading" style="display: none;">
                                                        <img src="Images/loading123.gif" alt="loading" />Please wait...</div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center" colspan="2">
                                                    <asp:Button ID="btnSubmit" OnClick="btnSubmit_Click" OnClientClick="sendDetails();" runat="server" Text="Submit"
                                                        class="formBtnEdit" />
                                                    <%--  <input type="button" id="btnSubmit" value="SUBMIT" onclick="sendPassword();" class="popupBtn" />--%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" colspan="2" width="100%">
                                                    <div id="ErrorDiv" class="errorDiv2" style="display: none; width: 380px;">
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>
            <center>
            </center>
        </div>
        <div style="clear: both">
        </div>
        <div>
            <uc1:footer runat="server" ID="footer"></uc1:footer>
        </div>
    </center>
    </form>
</body>
</html>
